package com.freeheart.aop.log.log;

import com.freeheart.aop.log.DefaultLogInterceptor;
import com.freeheart.aop.log.LogInterceptor;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class LogAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public LogInterceptor logInterceptor() {
        return new DefaultLogInterceptor();
    }


    @Bean
    public LogAspect logAspect(LogInterceptor logInterceptor) {
        return new LogAspect(logInterceptor);
    }


}
